@extends('layouts.app')

@section('content')
    <div class="container">
        <div class="row justify-content-center">
            <div class="col-md-8">
                <div class="card">
                    <div class="card-header">{{ __('Google Authenticator') }}</div>

                    <div class="card-body">
                        <form method="POST" action="{{ route('g2fa.verify', null, false) }}" class="text-center">
                            @csrf

                            <div class="form-group">@isset($qrCode) {!! $qrCode !!} @endisset</div>

                            <div class="form-group">
                                <div style="display: inline-block;">
                                    <input type="number" class="form-control @error('g2fa_code') is-invalid @enderror" name="g2fa_code" required>

                                    @error('g2fa_code')
                                    <span class="invalid-feedback" role="alert">
                                        <strong>{{ $message }}</strong>
                                    </span>
                                    @enderror
                                </div>
                            </div>

                            <div class="form-group">
                                <button type="submit" class="btn btn-primary">
                                    {{ __('Authenticate') }}
                                </button>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
@endsection
